import request from '../../utils/request'
import axios from 'axios'


export const findFileList = (current, size, fileVo) => {
  return axios({
    url: '/api/file/findFilePage',
    method: 'post',
    /*localhost:8080/user?id=  方式传值*/
    params: {
      current,
      size
    },
    /*json数据传值*/
    data: fileVo
  })
}


/*添加文件*/
export const saveFile = (file) => {
  return axios({
    url: '/api/file/addFile',
    method: 'post',
    data: file
  })
}

/*根据id删除文件*/
export const deleteFileById = (id) => {
  return axios({
    url: '/api/file/deleteFileById',
    method: 'post',
    params: {
      id
    },
  })
}

/*根据id批量删除文件*/
export const deleteFilesByIds = (ids) => {
  return axios({
    url: '/api/file/deleteFilesByIds',
    method: 'post',
    params: {
      ids
    },
  })
}

/*根据url删除文件*/
export const deleteFileByUrl = (fileUrl) => {
  return axios({
    url: '/api/file/deleteFileByUrl',
    method: 'post',
    params: {
      fileUrl
    },
  })
}

/*根据url批量删除文件*/
export const deleteFilesByUrls = (fileUrls) => {
  return axios({
    url: '/api/file/deleteFilesByUrls',
    method: 'post',
    params: {
      fileUrls
    },
  })
}



